<?php
//include "RestRequest.inc.php";
class Am_Grid_Action_Group_Delete extends Am_Grid_Action_Group_Abstract
{
    protected $id = 'group-delete';
    protected $batchCount = 10;
    protected $isDelete = true;
	protected $isJob = false;
	protected $apiNeo;
	public function setJob($isJob)
	{
		$this->isJob = $isJob;
		parent::setJob($isJob);
	}
	public function setAPI($api_type, $api_switch)
	{
		$this->apiNeo = Am_Di::getInstance()->apineo;
		$this->apiNeo->setAPIFull($api_type, $api_switch);
	}
    public function __construct($id = null, $title = null)
    {
        $this->title = ___("Delete");
        parent::__construct($id, $title);
    }
    
    public function handleRecord($id, $record)
    {
		if($this->isJob)
		{
		
			$result = $this->apiNeo->deleteAPIData($record->job_id_server);	
			
		}
        $this->grid->getDataSource()->deleteRecord($id, $record);
		
		
		
    }
}